﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RapidTestMapMaker
{
    public partial class LayerDialogUserControl : UserControl
    {
        private BigMap map;
        public BigMap Map
        {
            get { return map; }
            set {
                map = value;
                panel1.Controls.Clear();
                if (map == null) { return; }
                foreach (MapLayer layer in map.Layers)
                {
                    LayerUserControl layerControl = new LayerUserControl();
                    layerControl.Layer = layer;
                    layerControl.Dock = DockStyle.Top;
                    panel1.Controls.Add(layerControl);
                }
            }
        }

        public LayerDialogUserControl()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ParentForm.DialogResult = DialogResult.OK;
        }
    }
}
